﻿// <copyright file="Game.cs" company="ThorIndustry">Copyright (c) ThorIndustry. All rights reserved.</copyright>

public class Game : UnityEngine.MonoBehaviour, IGameService
{
    public PuzzleManager PuzzleManager
    {
        get;
        set;
    }

    protected virtual void Awake()
    {
        UnityEngine.Screen.orientation = UnityEngine.ScreenOrientation.LandscapeLeft;
    }

    // Use this for initialization
    protected virtual System.Collections.IEnumerator Start()
    {
        IDatatableService datatableService = Services.GetService<IDatatableService>();
        while (datatableService == null)
        {
            yield return null;
            datatableService = Services.GetService<IDatatableService>();
        }

        // Create the puzzle manager and initialize it.
        this.PuzzleManager = new PuzzleManager();
        this.PuzzleManager.Initialize();

        Services.Register<IGameService>(this);
        yield break;
    }
}
